<div class="row row-cards row-deck">
  <div class="col-12">
    <div class="card">
      <%= form_tag reporter_admin_shop_path(@shop), method: "get" do %>
      <div class="card-header">
        <div class="col-sm-6 col-md-4">
          <div class="form-group">
            <label class="form-label">开始时间</label>
            <input type="date" name="begin_at" class="form-control" />
          </div>
        </div>
        <div class="col-sm-6 col-md-4">
          <div class="form-group">
            <label class="form-label">结束时间</label>
            <input type="date" name="end_at" class="form-control" />
          </div>
        </div>
        <div class="col-sm-6 col-md-4">
          <div class="form-group">
            <label class="form-label">&nbsp;</label>
            <%= submit_tag "搜索", { class: "btn btn-primary" } %>
            <a href="<%= reporter_admin_shop_path(@shop, begin_at: @begin_at, end_at: @end_at, download: true) %>" class="btn btn-danger">下载</a>
          </div>
        </div>
      </div>
      <% end %>
      <table class="table table-hover table-outline table-vcenter text-nowrap card-table">
        <thead>
          <tr>
            <th>订单编号</th>
            <th>总价</th>
            <th>下单用户</th>
            <th>下单电话</th>
            <th>付款方式</th>
            <th>订单状态</th>
            <th class="text-center">
            </th>
          </tr>
        </thead>
        <tbody>
          <% @orders.each do |order| %>
            <tr>
              <td>
                <div><%= order.trade_no %></div>
                <div class="small text-muted">
                  <%= formattime(order.created_at, unit: "hour") %>
                </div>
              </td>
              <td>
                <div><%= order.total_fee %></div>
              </td>
              <td>
                <div><%= order.user.nickname %></div>
              </td>
              <td>
                <div><%= order.user.phone %></div>
              </td>
              <td>
                <div><%= i18n_enum order, :pay_method %></div>
              </td>
              <td>
                <div>
                  <span class="status-icon bg-success"></span>
                  <%= i18n_enum order, :state %>
                </div>
              </td>
              <td class="text-center">
                <div class="item-action dropdown">
                  <a href="javascript:void(0)" data-toggle="dropdown" class="icon"><i class="fe fe-more-vertical"></i></a>
                  <div class="dropdown-menu dropdown-menu-right">
                  </div>
                </div>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
      <div class="card-footer">
      </div>
    </div>
  </div>
</div>